

import { defineStore } from "pinia";
import { ref } from 'vue';

export const useHomeStore = defineStore('home', () => {
  const safeArea = ref({})
  const capButton = ref({})

  const res = uni.getSystemInfoSync()



  // 条件编译
  // 只有微信小程序平台，才执行注释中的代码
  // #ifdef MP-WEIXIN
  capButton.value = uni.getMenuButtonBoundingClientRect()
  // #endif
  safeArea.value = res.safeArea

  return { safeArea, capButton }
})